<include file='public/_meta'>
<title>车辆列表</title>
<body>

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 车辆档案 <span class="c-gray en">&gt;</span> 车辆列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-c" id="search_down"> 添加日期：
        <input type="text" onfocus="WdatePicker({ maxDate:'#F{ $dp.$D(\'datemax\')||\'%y-%M-%d\' }' })" id="datemin" class="input-text Wdate" style="width:100px;">
        -
        <input type="text" onfocus="WdatePicker({ minDate:'#F{ $dp.$D(\'datemin\') }',maxDate:'%y-%M-%d' })" id="datemax" class="input-text Wdate" style="width:100px;">
        <input type="text" class="input-text" style="width:250px" placeholder="车牌、车架、卡号、智能设备号..." id="search_inpute" >
        <button type="submit" class="btn btn-success radius" id="search_btn"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>       
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort">
            <thead>
                <tr class="text-c">
                    <th width="160">电话号码</th>
                    <th width="">发送内容</th>
                    <th width="">模板类型</th>
                    <th width="160">时间</th>
                </tr>
            </thead>
            <tbody>
                
            </tbody>
        </table>
    </div>
    <div id="modal-demo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content radius">
                <div class="modal-header">
                    <h3 class="modal-title">短信上行</h3>
                    <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                </div>
                <div class="modal-body" id="message-content">
                    <p></p>
                </div>
                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!--_footer 作为公共模版分离出去-->
<include file='public/_footer'>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__PUBLIC__/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/h-ui/js/H-ui.js"></script>
<!-- <script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.js"></script> -->
<script type="text/javascript">

$(function(){
    var table = $('.table-sort').DataTable({
        "aaSorting": [[ 0, "desc" ]],//默认第几个排序
        // "bStateSave": true,//状态保存
         searching: false,
        "aoColumnDefs": [
          //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
          {"orderable":false,"aTargets":[0,1,2,3]}// 制定列不参与排序
        ],
        "bProcessing" : true, //开启读取服务器数据时显示正在加载中……特别是大数据量的时候，开启此功能比较好  
        "bServerSide" : true,//服务器处理分页，默认是false，需要服务器处理，必须true  
        "ajax": {
            "url": "{:url('index/message/smsdown')}",
            "type": "POST"
        },
        displayLength: 10,
        columns: [
        { data: 'recNum'},
        { data: 'templateParam' },
        { data: 'templateType'},
        { render:function (data, type, row, meta) {
            if(row.time!=null && row.time!=0){
                let formatTimeS = new Date(row.time*1000);
                let _year = formatTimeS.getFullYear()
                let _month = formatTimeS.getMonth()+1;
                let _date = formatTimeS.getDate();
                let _hour = formatTimeS.getHours();
                let _minute = formatTimeS.getMinutes();
                let _second = formatTimeS.getSeconds();
                return _year+'-'+_month+'-'+_date+' '+_hour+':'+_minute+':'+_second;
                
            }else{
               data = '未知'; 
            }
                
            return data;
            } 
        },
        ],   
    });

    $("#search_btn").click(res=>{
        request();
    });

    $("#search_down").keydown(event=>{
           if (event.which == 13){
                request();
           }
    })

    function request() {
        table.settings()[0].ajax.data = {
            'datemin':$('#datemin').val(),
            'datemax':$('#datemax').val(),
            'search_inpute':$('#search_inpute').val()
        };
        table.ajax.reload();
    }

});
</script>
</body>
</html>